﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Serialization;
using DependencyInjection;
using PolarExpress.Model.Interfaces;

namespace PolarExpress.Model
{
    public class ProjectManager : IProjectManager
    {
        ISerializer _serializer;

        [Inject]
        public ProjectManager(ISerializer serializer)
        {
            _serializer = serializer;
        }

        public void Save(string filename, IProject project)
        {
            _serializer.Save<IProject>(filename, project);
        }

        public void Load(string filename, IProject project)
        {
           project = _serializer.Load<IProject>(filename);
        }

        public event ModelChangedHandler ModelChanged;
    }
}
